#include "defs.h"

extern int main();
extern void put_num(uint64_t);
extern void do_timer(void);
extern unsigned long long ticks;
extern void clock_set_next_event(void); 

void handler_s(uint64_t cause, uint64_t epc )
{
	if ((cause>>63)==1) 
	{
		// supervisor timer interrupt
		if ((cause<<1)%256==(5<<1))
		{
			//设置下一个时钟中断，打印当前的中断数目。
    		do_timer();
    		clock_set_next_event();
		}
	}
	return;
}

